﻿using System.Data;

namespace Marmat.Forms.Views
{
    namespace DataGrid
    {
        public class FocusedRowChangedEventArgs : Grid.FocusedRowChangedEventArgs
        {
            internal FocusedRowChangedEventArgs(DevExpress.XtraGrid.Views.Base.BaseView sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs info) : base(sender, info)
            {
            }

            /// <summary>
            /// 获取当前选中的行。
            /// </summary>
            /// <value></value>
            /// <returns></returns>
            /// <remarks></remarks>
            public new Row Row
            {
                get
                {
                    if (this._Row is null)
                    {
                        DataRowView RowView = (DataRowView)base.Row;
                        this._Row = new Row(this.GridControl, RowView.Row);
                    }

                    return this._Row;
                }
            }

            private Row _Row;

            public new Forms.DataGrid GridControl
            {
                get
                {
                    return (Forms.DataGrid)base.GridControl;
                }
            }
        }
    }
}